<?php
require_once($_SERVER['DOCUMENT_ROOT']."/inc/Function_user.php");
if(!isset($_GET['a']) || !isset($_GET['m'])){
	header("HTTP/1.1 404 Not Found");
	header("Status: 404 Not Found");
	exit;
}
if($_GET['a']!="login" && $_GET['a']!=="reg" && $_GET['a']!=="yzm" && $_GET['a']!=="czyzm" && $_GET['a']!=="getpwd"){
	upower();
}
if(DEFINED($_GET['m'])){
	$moudel = constant($_GET['m']);
	include_once($_SERVER['DOCUMENT_ROOT']."/inc/".$moudel."_user_class.php");
	$class = new $moudel();
	if(is_callable(array($class,$_GET['a']))){
		$fun = $_GET['a'];
		$class->{$fun}($_POST);
	}else{
		header("HTTP/1.1 404 Not Found");
		header("Status: 404 Not Found");
		exit;
	}
}else{
	header("HTTP/1.1 404 Not Found");
}
?>